![]() |
PATH![]() |
![]() ![]() |
The RGB Color value class represents a collection of three integer values that specify the red, green, and blue components of a color. You can coerce a list of three integer values into an RGB color if each of the values is from 0 to 65535. In fact, AppleScript reports the class of an RGB Color value as List:
set myGreenRGB to {0, 65535, 0} as RGB color --result: {0, 65535, 0}
class of myGreenRGB --result: list
You can get or set individual values in an RGB color by accessing the items as you would those in any list:
set myRGB to {500,25000,500} as RGB color --result: {500, 25000, 500}
set myGreenValue to second item of myRGB --result: 25000
set item 3 of myRGB to 12000
myRGB --result: {500, 25000, 12000}
You can use the RGB Color value class to obtain RGB colors from, or supply RGB colors to, applications that work with RGB colors. For example, a graphic object in an AppleWorks drawing document has Fill Color and Pen Color properties that are RGB colors.